/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliveryUserReal;
import org.apache.ibatis.jdbc.SQL;

public class DeliveryUserRealSqlProvider {

    /* @mbggenerated */
    public String insertSelective(DeliveryUserReal record) {
        return new SQL() {
            {
                INSERT_INTO("delivery_user_real");

                if (record.getUserId() != null) {
                    VALUES("user_id", "#{userId,jdbcType=INTEGER}");
                }

                if (record.getRealName() != null) {
                    VALUES("real_name", "#{realName,jdbcType=VARCHAR}");
                }

                if (record.getIdentityCard() != null) {
                    VALUES("identity_card", "#{identityCard,jdbcType=VARCHAR}");
                }

                if (record.getIdentityCardFront() != null) {
                    VALUES("identity_card_front", "#{identityCardFront,jdbcType=VARCHAR}");
                }

                if (record.getIdentityCardBack() != null) {
                    VALUES("identity_card_back", "#{identityCardBack,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(DeliveryUserReal record) {
        return new SQL() {
            {
                UPDATE("delivery_user_real");

                if (record.getUserId() != null) {
                    SET("user_id = #{userId,jdbcType=INTEGER}");
                }

                if (record.getRealName() != null) {
                    SET("real_name = #{realName,jdbcType=VARCHAR}");
                }

                if (record.getIdentityCard() != null) {
                    SET("identity_card = #{identityCard,jdbcType=VARCHAR}");
                }

                if (record.getIdentityCardFront() != null) {
                    SET("identity_card_front = #{identityCardFront,jdbcType=VARCHAR}");
                }

                if (record.getIdentityCardBack() != null) {
                    SET("identity_card_back = #{identityCardBack,jdbcType=VARCHAR}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}